import { GCellRenderer } from "../../../../com/mui/controls/GCellRenderer";
import { GTextFormat } from "../../../common/GTextFormat";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
import { SQuestionMark } from "../../../../Message/Public/SQuestionMark";
import { ColorConfig } from "../../resource/ColorConfig";
type int = number;
//class QuestionRankRenderer
    
    export  class QuestionRankRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ configUI(): void
        {
            this._markTf = new GTextFormat("", 12, 16737792, null, null, null, null, null, flash.text.TextFormatAlign.CENTER);
            this._rankTf = new GTextFormat("", 12, 11661311, null, null, null, null, null, flash.text.TextFormatAlign.CENTER);
            this._rankTxt = this.createTextfield(20, 0, 20, 20, "1", this._rankTf);
            this._nameTxt = this.createTextfield(35, 0, 120, 20, "", this._rankTf);
            this._markTxt = this.createTextfield(135, 0, 50, 20, "42545", this._markTf);
            this._adoreBg = GlobalClass.getBitmap(ImagesConst.RangeAdore);
            return;
        }

        /* internal  */createTextfield(arg1: int, arg2: int, arg3: int, arg4: int, arg5: string, arg6: Object /* flash.text.TextFormat */): Object /* flash.text.TextField */
        {
            var loc1=null;
            (loc1 = new Object /* flash.text.TextField */()).x = arg1;
            loc1.y = arg2;
            loc1.width = arg3;
            loc1.height = arg4;
            loc1.text = arg5;
            loc1.selectable = false;
            loc1.mouseEnabled = false;
            loc1.setTextFormat(arg6);
            addChild(loc1);
            return loc1;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            var loc1=arg1.sQuestionMark as SQuestionMark;
            var loc2=arg1.index;
            this._rankTxt.text = loc2.toString();
            this._rankTxt.setTextFormat(this._rankTf);
            var loc3=ColorConfig.instance.getCountryColor(loc1.miniPlayer.camp).intColor;
            this._nameTxt.text = loc1.miniPlayer.name;
            this._nameTxt.setTextFormat(new GTextFormat("", 12, loc3, null, null, null, null, null, flash.text.TextFormatAlign.CENTER));
            this._markTxt.text = loc1.mark + "";
            this._markTxt.setTextFormat(this._markTf);
            if (loc2 <= 3) 
            {
                addChild(this._adoreBg);
            }
            return;
        }

        /* internal */ /* var */_rankTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_nameTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_markTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_markTf: Object /* flash.text.TextFormat */;

        /* internal */ /* var */_rankTf: Object /* flash.text.TextFormat */;

        /* internal */ /* var */_adoreBg: Object /* flash.display.Bitmap */;
    }
